<?
// *************************************
// * resources.php allows the admin to
// * View and Delete resources and view
// * resource stats.
// *************************************
$toolbox = 1;
$sajax   = 1;
$richtext= 2;
define('SITE_AREA', 'resources');

$jsFile = "jsResources.js";
include("includes/functions.php");
include($pre."includes/sajax/sajaxResources.php");

sajax_init();
$sajax_request_type = "POST"; 
sajax_export("getResources");
sajax_export("getNewResources");
sajax_export("addResourceCat");
sajax_export("removeResourceCat");
sajax_export("removeOrphanedCats");
sajax_export("saveResource");
sajax_export("deleteResource");
sajax_export("getResourceForEdit");
sajax_export("exportResources");
sajax_export("getBadLinks");

sajax_export("search");

// These are questionable 
sajax_export("resourceEdit");
sajax_export("linkCheck");
sajax_export("linkCheckConfirm");
sajax_export("submitLink");
sajax_export("getLevelSelects");
sajax_export("toggleLinkStatus2");
sajax_export("deleteLink");
sajax_export("resourceEditConfirm");
sajax_export("toggleLinkStatus");

sajax_handle_client_request();

//$newResourceString = getNewResources();

include("includes/header.php"); ?>
<script language="javascript" type="text/javascript" src="<?=$pre; ?>js/tinyeditor/config/config<?=$richtext; ?>.js"></script>
	<div id="addEditFormDiv" style="display: none;"></div>	
	
	<div id="content0">
		<div id="buttonNew" style="float: left; width: 180px;"><input type="button" class="buttonBig buttonAddBig" value="New Link" onClick="addResource();" title="Add new resource" id="buttonAddResource" /></div>
		<div id="statusDiv" style="float: left;"></div>
		<div style="clear: left; height: 10px;"></div>
		
		<div id="content0FormDiv">
		<div id="formNewResource" class="blueBox" style="display: none;">		
			<input type="hidden" id="formAction" />
			<input type="hidden" id="linkID" />
			<input type="hidden" id="pathID" />
			
			<p><label class="vertLabel">Title</label>
			<input type="text" style="width: 400px;" id="pTitleBox" name="pTitleBox" /></p>
			
			<p><label class="vertLabel">Link URL</label>
			<input type="text" style="width: 400px;" value="http://" id="pURL" name="pURL" /></p>
						
			<p><label class="vertLabel">Short description</label>
			<textarea name="pShortDesc" id="pShortDesc" class="somewhatAdvanced" style="width: 100%; height: 200px;"></textarea>
			</p>
			<p><label>Associated categories for resource</label>
				<? toolTip('productFiles'); echo $toolTip; ?>
			</p>		
			<div id="catContainer">
				<div id="associatedCatContainer" style="margin-top: 10px;"></div>
				<div id="newCat">
					<table>
					<tr>
						<td id="selectParent"></td>
						<td id="pathSave" style="display: none;"><input type="image" onClick="addResourceCat();" src="images/button_add.gif" style="border: none;" title="Add resource category" /></td>
					</tr>
					</table>								
				</div>				
			</div>
			
			<p style="margin-top: 15px; margin-left: 6px;">
				<input type="button" class="buttonBig buttonSaveBig" onClick="saveResource();" value="Save" title="Save resource" />
				<input type="button" class="buttonBig buttonCancelBig" onClick="cancelResource();" value="Cancel" title="Cancel" />
			</p>
		</div>
		</div>
		<!-- New form resource went here -->		
		
		<div id="resourcePath"><h3>New Link Submissions</h3><!-- Displays the resource path just to know where we are --></div>
		<div id="resourceList"></div>
	</div>
	
	<div id="content1">
		<div id="resourceSearchList"></div>
	</div>
	<div id="content2">
		<h1>Bad Links</h1>
		<div id="badLinksList"></div>
	</div>
	<div id="south" class="x-layout-inactive-content">
	south - generally for informational stuff, also could be for status bar
	</div>
<? include("includes/footer.php"); ?>